﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Frogism.Core {
  public interface INetWorthFilter {
    bool ValidAccount(IAccount account);
  }
  public class RetirementFilter : INetWorthFilter {

    public bool ValidAccount(IAccount account) {
      return (account.AccountType == DBConst.AccountTypeRetirement);
        
    }
  }
  public class InvestmentFilter : INetWorthFilter {

    public bool ValidAccount(IAccount account) {
      return (account.AccountType == DBConst.AccountTypeInvestment);

    }
  }
  public class MortgageFilter : INetWorthFilter
  {

      public bool ValidAccount(IAccount account)
      {
          return (account.AccountType == DBConst.AccountTypeMortgage);
      }
  }
  public class CashFilter : INetWorthFilter {

    public bool ValidAccount(IAccount account) {
      switch(account.AccountType) {
        case DBConst.AccountTypeChecking:
        case DBConst.AccountTypeSavings:
          return true;
        case DBConst.AccountTypeCreditCard:
        case DBConst.AccountTypeInvestment:
        case DBConst.AccountTypeRetirement:
        default:
          return false;
      }
    }
  }
  public class DebitFilter : INetWorthFilter {

    public bool ValidAccount(IAccount account) {
      switch(account.AccountType) {
        case DBConst.AccountTypeCreditCard:
          return true;
        case DBConst.AccountTypeChecking:
        case DBConst.AccountTypeSavings:
        case DBConst.AccountTypeInvestment:
        case DBConst.AccountTypeRetirement:
        default:
          return false;
      }
    }
  }
  public class AntiFilter : INetWorthFilter {

    public bool ValidAccount(IAccount account) {
          return true;
    }
  }
  public class LiquidFilter : INetWorthFilter {

    public bool ValidAccount(IAccount account) {
      switch(account.AccountType) {
        case DBConst.AccountTypeCreditCard:
        case DBConst.AccountTypeChecking:
        case DBConst.AccountTypeSavings:
          return true;
        case DBConst.AccountTypeInvestment:
        case DBConst.AccountTypeRetirement:
        default:
          return false;
      }
    }
  }
}
